<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
         <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
        <title>支付回收金</title>
        <link rel="stylesheet" href="<c:url value="/static/wx/css/style.css"/>" />
        <script type="text/javascript" src="<c:url value="/static/wx/js/lib/rem.js"/>"></script>
    </head>
    <body class="befeff4">
        <div id="wrap">
            <div class="wrap_order">
                <div class="wrap_address mt10 padding20 wa">
                    <ul class="ul_info">
                        <li><label>预约 </label><span>${orderVo.pickTime }</span></li>
                        <li><label>下单时间  </label><span>${orderVo.createTime.substring(5,16) }</span></li>
                        <li><label>联系信息  </label><span>${orderVo.city }${orderVo.area }${orderVo.address }</span></li>
                        <li><label></label><span>${orderVo.userContacts }  ${orderVo.userTelephone }</span></li>
                        <li><label>应付金额</label><span class="cff6633">${total }元</span></li>
                    </ul>
                </div>
                <div id="wrap_select_all" class="bf">
                    <div class="pay_select_title">选择支付方式</div>
                    <div class="wrap_select">
                        <div class="wrap_pay_lower common_list boder-bottom on" data="1">
                            <div class="common relative">
                            <img class="pay_lower_img" src="<c:url value="/static/wx/img/pay_lower.png"/>" />
                            <label>线下支付</label>
                            <i class="icon"></i>
                            </div>
                        </div>
                        <div class="wrap_pay_upper common_list" data="2">
                            <div class="common relative">
                            <img class="pay_upper_img" src="<c:url value="/static/wx/img/pay_upper.png"/>" />   
                            <label class="c999">平台转账（暂未开放）</label>
                            <i class="icon"></i>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="wrap_btn mt50">
                <a href="javascript:void(0)"  class="button" id="submit_btn">确认支付</a>
            </div>
            <!--下单成功提示弹窗开始-->
            <div class="msg-succ">
                <img src="<c:url value="/static/wx/img/succ_icon.png"/>" /> <span class="f20">支付成功</span> 
            </div>
            <!--下单成功提示弹窗结束-->
        </div>
        <input type="hidden" id="receiptId"  value="${orderVo.receiptId }" />
        <input type="hidden" id="id"  value="${orderVo.id }" />
        <script type="text/javascript" src="<c:url value="/static/wx/js/lib/jquery-3.3.1.min.js"/>" ></script>
        <script type="text/javascript">
            //提交
	        $("#submit_btn").on("click",function(){
	        	$(".mask").hide();
                var f = arguments.callee, self = this;
	            var receiptId = $("#receiptId").val();
	            var id = $("#id").val();
	            var orderNumber = $("#orderNumber").val();
	            
	            $.ajax({
	                type: "post",
	                url: "<c:url value="/wx/toUpdateStatus.do"/>",
	                data: {
	                    paymentType : 1,
	                    paymentStatus : 1,
	                    id : id,
	                    status : 2
	                },
	                cache: true, 
	                async:false, 
	                dataType: "json",
	                success: function(data){
	                    if (data.msg == "1") {
	                        $(".msg-succ").show();
	                        setTimeout(hideTips(receiptId), 3000);
	                    }else{
	                    	 $(self).click(f);
	                    }
	                }
	            });
	        })
            function hideTips(receiptId){
                $(".msg-error").hide();
                window.location.href = "<c:url value="/wx/toReceiptList.do"/>?id="+receiptId;
            }
            
        </script>
    </body>
</html>
